package me.tuyou.jdbc;

import me.tuyou.jdbc.po.User;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description
 * @Author tuyou_cd
 * @Date 2020/6/2 14:21
 */
public class JDBCApp {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext("me.tuyou.jdbc");
        User user = applicationContext.getBean(User.class);
        user.createTableIfNotExists();

        user.setName("tuyou");
        user.setAge(22);
        user.save();

        System.out.println(user.queryAll());
    }
}
